﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WordWonderGame.UI.Man4
{
    public partial class FormDapAn : UserControl
    {
        public event EventHandler DapAnClick;
        private bool lockDapAn;
        public int Code { get; set; }
        public string Tu
        {
            get
            {
                return lbTu.Text;
            }

            set
            {
                lbTu.Text = value;
            }
        }

        public FormDapAn()
        {
            InitializeComponent();
        }

        private void FormDapAn_Click(object sender, EventArgs e)
        {
            if (!lockDapAn)
            {
                if (DapAnClick != null)
                {
                    DapAnClick(this, null);
                }
            }
        }

        private void lbTu_Click(object sender, EventArgs e)
        {
            if (!lockDapAn)
            {
                if (DapAnClick != null)
                {
                    DapAnClick(this, null);
                }
            }
        }

        public void ChuyenMauBlue()
        {
            this.BackgroundImage = imageList1.Images[1];
            lbTu.ForeColor = Color.Yellow;
        }

        public void ChuyenMauXam()
        {
            //System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))))
            this.BackgroundImage = imageList1.Images[2];
            lbTu.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
            lockDapAn = true;
        }

        public void ChuyenMauXanh()
        {
            this.BackgroundImage = imageList1.Images[0];
            lbTu.ForeColor = Color.Blue;
        }
    }
}
